﻿@using HiLand.General.Entity
@model  LoanBasicEntity
@{
    Layout = null;
    bool isDisplayGenerateButton = false;
    isDisplayGenerateButton = (bool)this.ViewData["isDisplayGenerateButton"];
}
<div id="LoanInfoForScheduleContainer">
@using (Html.BeginForm())
{ 
    <span>No.:</span>@Model.LoanID <span>EnterpriseName:</span>@Model.LoanUserName
    <span>Amount:</span>@Model.LoanAmount <br />
    @Html.Hidden("loanGuid", Model.LoanGuid)
    if (isDisplayGenerateButton == true)
    {
        <input type="button" class="" id="btnSave" value="Generate Schedule" />
    }
}
</div>

        <script type="text/javascript">
            $(document).ready(function () {
                $("#LoanInfoForScheduleContainer #btnSave").click(function () {
                    $("#LoanInfoForScheduleContainer form").ajaxSubmit({
                        success: function (responseInfo) {
                            if (responseInfo.IsSuccessful == false) {
                                alert(responseInfo.statusMessage);
                            }
                            else {
                                //alert(responseInfo.IsSuccessful);
                                window.location.reload();
                            }
                        },
                        data: { "isAjaxDeal": "true" }
                    });
                });
            });
        </script>
